#!/usr/bin/env ruby

require 'json'
require 'rest-client'

LKP_SRC = ENV['LKP_SRC'] || File.direname(File.dirname(File.realpath($PROGRAM_NAME)))

if ENV['RESULT_ROOT']
    fn = File.join ENV['RESULT_ROOT'], 'majun-codecheck-result'
elsif ARGV[0]
    fn = ARGV[0]
end

result_json = File.read(fn)
result = JSON::parse(result_json)

puts ".result.state: #{result['state']}"
puts ".result.url: #{result['data']}"
